<template>
  <el-dialog
    title="导入人员"
    :visible.sync="dialogVisible"
    width="500px"
  >
    <DragUpload>
      <el-link @click="getTemplate">下载模版</el-link>
    </DragUpload>
    <span slot="footer" class="dialog-footer">
      <el-button @click="onClose">取 消</el-button>
      <el-button type="primary" @click="onSave">确 定</el-button>
    </span>
  </el-dialog>

</template>

<script>
import DragUpload from '@/components/DragUpload';
import { http_user } from '@/api';
import { downloadFile } from '@/utils/download';

export default {
  name: 'Import',
  components: {
    DragUpload
  },
  data() {
    return {
      dialogVisible: false
    }
  },
  methods: {
    onSave() {

    },
    onClose() {
      this.dialogVisible = false
    },
    getTemplate() {
      // 这里是将url转成blob地址，
      http_user.downloadtemplate().then(res => {
        downloadFile('人员模版.xlsx', res)
      })
    }
  }
}
</script>

<style scoped lang="scss">
</style>
